/*************************************************************************
	> File Name: 005.sprintf实现字符串拼接.c
	> Author: Maureen 
	> Mail: Maureen@qq.com 
	> Created Time: 三  8/18 18:52:34 2021
 ************************************************************************/

#include <stdio.h>

/*
 * sprintf函数原型:
 * int sprintf( char* buffer, const char* format, ... ); //写结果到字符串 buffer 
 */

int main() {
    char str[100] = {0};
    sprintf(str, "%d.%d.%d.%d", 192, 168, 0, 1);
    printf("%s\n", str); //输出192.168.0.1
    return 0;
}

